<template>
  <div class="app-container">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="small" label-width="100px">

        <el-col :span="6">
          <el-form-item label="类型" prop="tpType">
            <el-select v-model="formData.tpType" placeholder="请选择类型：TP" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpTypeOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="材质" prop="tpMaterial">
            <el-select v-model="formData.tpMaterial" placeholder="请选择材质：A(铝)材质" clearable
                       :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpMaterialOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="齿形" prop="tpTooth">
            <el-select v-model="formData.tpTooth" placeholder="请选择齿形：S5M" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpToothOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="带宽" prop="tpBandwidth">
            <el-select v-model="formData.tpBandwidth" placeholder="请选择齿形对应的带宽带宽" clearable
                       :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpBandwidthOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="齿数" prop="tpTeethNum">
            <el-select v-model="formData.tpTeethNum" placeholder="请选择齿数" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpTeethNumOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="形状" prop="tpShape">
            <el-select v-model="formData.tpShape" placeholder="请选择形状:A(无凸台)形状" clearable
                       :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpShapeOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="轴孔类型" prop="tpAxleHoleType">
            <el-select v-model="formData.tpAxleHoleType" placeholder="请选择轴孔类型:A(圆孔)" clearable
                       :style="{width: '100%'}">
              <el-option v-for="(item, index) in tpAxleHoleTypeOptions" :key="index" :label="item.label"
                         :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="内孔直径" prop="innerBoreDiameter">
            <el-input v-model="formData.innerBoreDiameter" placeholder="请输入内孔直径如：d10" clearable
                      :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="请输入型号" prop="hlTimingPulley">
            <el-input v-model="formData.hlTimingPulley" placeholder="请输入请输入型号" clearable
                      :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item size="small">
            <el-button type="primary" icon="el-icon-search" @click="submitForm">提交</el-button>
            <el-button icon="el-icon-refresh" @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>

      </el-form>
    </el-row>
  </div>
</template>
<script>
import {

} from "@/api/hualian/type";

export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        tpType: undefined,
        tpMaterial: undefined,
        tpTooth: undefined,
        tpBandwidth: undefined,
        tpTeethNum: undefined,
        tpShape: undefined,
        tpAxleHoleType: undefined,
        innerBoreDiameter: undefined,
        hlTimingPulley: undefined,
      },
      rules: {
        tpType: [],
        tpMaterial: [],
        tpTooth: [],
        tpBandwidth: [],
        tpTeethNum: [],
        tpShape: [],
        tpAxleHoleType: [],
        innerBoreDiameter: [],
        hlTimingPulley: [{
          required: true,
          message: '请输入请输入型号',
          trigger: 'blur'
        }],
      },
      tpTypeOptions: [],
      tpMaterialOptions: [],
      tpToothOptions: [],
      tpBandwidthOptions: [],
      tpTeethNumOptions: [],
      tpShapeOptions: [],
      tpAxleHoleTypeOptions: [],
    }
  },
  computed: {},
  watch: {},
  created() {
    this.tpTypeList();
  },
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
